package com.steve.xfood;

import com.steve.xfood.dto.OrderDTO;
import com.steve.xfood.dataobject.OrderDetail;
import com.steve.xfood.dataobject.OrderMaster;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;

/**
 * @author steve
 */
@SpringBootApplication
@MapperScan("com.steve.xfood.dataobject.mapper")
@EnableCaching //开启缓存
public class XFoodApplication {

    public static void main(String[] args) {
        SpringApplication.run(XFoodApplication.class, args);
    }

    /**
     * 创建OrderDTO的容器bean
     * @return
     */
    @Bean
    public OrderDTO orderDTO() {
        return new OrderDTO();
    }

    /**
     * 创建OrderMaster的容器bean
     * @return
     */
    @Bean
    public OrderMaster orderMaster() {
        return new OrderMaster();
    }

    /**
     * 创建OrderDetail的容器bean
     * @return
     */
    @Bean
    public OrderDetail orderDetail() {
        return new OrderDetail();
    }

}
